package com.easy.service.impl;

import com.easy.bean.Trainer;
import com.easy.dao.ITrainerDao;
import com.easy.service.ITrainerService;
import com.easy.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class TrainerImpl implements ITrainerService {

    @Autowired
    ITrainerDao dao;

    @Override
    public List<Trainer> getTrainer(Trainer trainer, Page page) {
        return dao.getTrainer(trainer,page);
    }

    @Override
    public int getTrainerCount(Trainer trainer) {
        return dao.getTrainerCount(trainer);
    }

    @Override
    public int delTrainer(int trainerID) {
        return dao.delTrainer(trainerID);
    }

    @Override
    public Trainer getTrainerByID(int trainerID) {
        return dao.getTrainerByID(trainerID);
    }

    @Override
    public int addTrainer(Trainer trainer) {
        return dao.addTrainer(trainer);
    }

    @Override
    public int editTrainer(Trainer trainer) {
        return dao.editTrainer(trainer);
    }

    @Override
    public List<Trainer> getAllTrainer() {
        return dao.getAllTrainer();
    }
}
